package alg20250206;

public class Text {
    public void moveZeroes(int[] nums){
        int n = nums.length;
        for (int cur = 0, dest = -1; cur < n;cur++) {
            if(nums[cur] != 0){
                swap(nums, ++dest, cur);
            }
        }
    }
    private void swap(int[] nums, int i, int j){
        int t = nums[i];
        nums[i] = nums[j];
        nums[j] = t;
    }
}
